package cn.cleanarch.infra.idp.pms.dao.repository;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.cleanarch.infra.idp.pms.dao.mapper.ProjectMapper;
import cn.cleanarch.infra.idp.pms.domain.entity.Project;
import cn.cleanarch.infra.idp.pms.domain.query.ProjectQuery;
import cn.cleanarch.infra.idp.commons.domain.dto.PageResult;
import org.springframework.stereotype.Component;
import org.apache.ibatis.annotations.Param;

/**
 * 项目Repository类
 */
@Component
public class ProjectRepository extends ServiceImpl<ProjectMapper, Project> implements IService<Project> {
    
    /**
     * 分页查询项目
     * @param page 分页参数
     * @param query 查询参数
     * @return 分页结果
     */
    public Page<Project> pageQuery(ProjectQuery query) {
        return this.baseMapper.pageQuery(new Page<>(query.getPageNo(), query.getPageSize()), query);
    }
}